<?PHP
header("Content-type: text/html; charset=utf-8");
include_once "DB_Oracle.php";
$Db_sql=new DB_Oracle();

if(isset($_POST['a'])){
	$sql="update paras_set_monitor t set t.use_state=0  where t.monitor_id=".$_POST['a']."";
	$is=$Db_sql->query($sql);
	if($is)
	echo "Y";
	else echo "N";
	exit();
	}

$sql="select * from paras_set_monitor t where t.monitor_time<sysdate and t.monitor_time>sysdate-120/(3600*24) and t.use_state=1";
$arr=$Db_sql->fetch_all_array($sql);
if(count($arr)!=0){
	echo $arr[0]['MONITOR_ID']."_".$arr[0]['VEHICLE_NAME'];
	}
else{
	echo "N";
	}
?>